<template>
  <div class="tiaoxuan_head">
    <van-icon @click="toback" class="icon_back_" name="arrow-left" />
    <van-dropdown-menu>
      <van-dropdown-item v-model="value1" :options="option1" @change="changeorder" />
      <van-dropdown-item v-model="value2" :options="option2" />
      <van-dropdown-item v-model="value3" :options="option3" />
    </van-dropdown-menu>
  </div>
</template>

<script>
export default {
  props: {},
  data() {
    return {
      value1: 0,
      value2: 1,
      value3: 2,

      option1: [
        { text: "排序", value: 0 },
        { text: "价格从低到高", value: 1 },
        { text: "价格从高到低", value: 2 },
        { text: "按品牌排序", value: 3 },
        { text: "使用年限从低到高", value: 4 },
        { text: "使用年限从高到低", value: 5 },
      ],
      option2: [
        { text: "租车公司", value: 1 },
        { text: "新款商品", value: "b" },
        { text: "活动商品", value: "c" },
      ],
      option3: [
        { text: "车辆品牌", value: 2 },
        { text: "新款商品", value: "B" },
        { text: "活动商品", value: "C" },
      ],
    };
  },
  methods: {
    toback() {
      window.history.back();
    },
    //选项改变
    changeorder(v){
      console.log(v)
    }
  },
  components: {},
};
</script>

<style scoped lang="less">
.tiaoxuan_head {
  width: 100%;
  height: 0.88rem;
  background: white;
  position: absolute;
  top: 0;
  left: 0;
  .icon_back_ {
    position: absolute;
    width: 0.4rem;
    height: 0.4rem;
    top: 0.24rem;
    left: 0.24rem;
    font-size: 0.4rem;
    z-index: 2;
  }
  .tiao_head {
    width: 95%;
    height: 0.88rem;
    display: flex;
    justify-content: space-evenly;
    align-items: center;
    position: absolute;
    top: 0;
    right: 0;
    li {
      flex: 1;
      height: 100%;
      line-height: 0.88rem;
      text-align: center;
      span {
        font-size: 0.26rem;
        font-weight: 600;
      }
      i {
        transform: rotateZ(90deg);
        color: #cccccc;
      }
    }
  }
}
</style>
